******************************************************************************************
*** The weight on her shoulders: Marginalization of women legislators in parliaments   *** 
*** and substantive representation of women   										   ***
*** Itzkovitch-Malka & Oshri            											   ***
*** 2024-06-19                        												   ***
******************************************************************************************

** setup
* packages (if needed)

ssc install bspline
ssc install blindschemes
ssc install interflex

* data 
use RIM_OO_BJPolS_dataset.dta, clear

*****************************************************************************************************
**Table A2
*****************************************************************************************************
*Model 1, Figure 1
nbreg genderbills gender nonfemalepro  in_govt minister1 i.partyfamily knesset_term cs*, robust nolog
margins, at(gender=(0 1)) level(90)
  marginsplot, recast(scatter) plotopts(msiz(vsmall) mc(gs4)) ciopts(lw(medthick)) ///
	xscale(range(0 1)) xtitle(" ") xsc(r(-.99 1.7)) scheme(s1mono) ///
	aspectratio(2) ytitle("Predicted number of gender-related bills") title("") name(gendermaineffect, replace)

*Model 2, Figure 2
nbreg genderbills i.gender##c.term_num Listmarginality parlrole descr_repper percentofwomeninparty nonfemalepro in_govt i.partyfamily minister1 knesset_term cs*, robust nolog
margins, at(term_num=(1 3 5 7 9 11) gender =(0 1))
	marginsplot, ytitle("Predicted probablity to sponsor gender-related bills") ///
   xtitle("Parliamentary tenure") title("") scheme(s1mono) ysc(r(0 1.5))name(tenure_interaction, replace)

*Model 3
nbreg genderbills i.gender##c.Listmarginality term_num parlrole descr_repper percentofwomeninparty nonfemalepro in_govt i.partyfamily minister1 knesset_term cs*, robust nolog

*Model 4
nbreg genderbills i.gender##i.parlrole term_num Listmarginality descr_repper percentofwomeninparty nonfemalepro in_govt i.partyfamily minister1 knesset_term cs*, robust nolog

*Model 5, Figure 3
nbreg genderbills i.gender##i.in_govt term_num Listmarginality percentofwomeninparty descr_repper nonfemalepro parlrole i.partyfamily knesset_term minister1 cs*, robust nolog
margins if  in_govt==1, at(gender=(0 1)) at((mean) _all) level(90)
  marginsplot, recast(scatter) plotopts(msiz(vsmall) mc(gs4)) ciopts(lw(medthick)) ///
	xscale(range(0 1)) xsc(r(-.99 1.7)) xtitle(" ") scheme(s1mono) ///
	aspectratio(2) ytitle("Predicted number of gender-related bills") title("coalition legislators") name(coalition_gender, replace)
margins if  in_govt==0, at(gender=(0 1))  level(90)
  marginsplot, recast(scatter) plotopts(msiz(vsmall) mc(gs4)) ciopts(lw(medthick)) ///
	xscale(range(0 1)) xsc(r(-.99 1.7)) xtitle(" ") scheme(s1mono) ///
	aspectratio(2) ytitle("Predicted number of gender-related bills") title("opposition legislators") name(opposition_gender, replace)
graph combine coalition_gender opposition_gender, scheme(s1mono) ycommon

*Model 6+7, Figure 4
nbreg genderbills i.gender##c.descr_repper in_govt parlrole term_num Listmarginality percentofwomeninparty nonfemalepro i.partyfamily minister1 knesset_term, robust nolog
margins, at(descr_repper=(0 0.05 0.1 0.15 0.2 0.22) gender =(0 1))
	marginsplot, ytitle("Predicted number of gender-related PMBs") ///
   xtitle("Female descriptive representation in parliament") title("") scheme(s1mono) ysc(r(0 3.5))name(descrep_interaction, replace)
 
nbreg genderbills i.gender##c.percentofwomeninparty descr_repper in_govt parlrole term_num Listmarginality nonfemalepro i.partyfamily minister1 knesset_term cs*, robust nolog
margins, at(percentofwomeninparty=(0. 0.1 0.2 0.3 0.4 0.5) gender =(0 1))
	marginsplot, ytitle("Predicted number of gender-related PMBs") ///
   xtitle("Female descriptive representation in Party") title("") scheme(s1mono) ysc(r(0 4)) name(descrparty_interaction, replace)
graph combine descrep_interaction descrparty_interaction, scheme(s1mono) ycommon

*Figure 5
graph twoway lfitci genderbills term_num if gender==1 & descr_rep<10 , scheme(s1mono) ytitle("Number of gender-related bills") xtitle("Parliamentary tenure") xscale(range(0 8)) xlabel(0 2 4 6 8) legend(off) title("Low female rep in parliament") name(lowdesrep, replace)

graph twoway lfitci genderbills term_num if gender==1 & descr_rep>=10 , scheme(s1mono) ytitle("Number of gender-related bills") xtitle("Parliamentary tenure") xscale(range(0 8)) xlabel(0 2 4 6 8) legend(off) title("High female rep in parliament") name(highdesrep, replace)

graph twoway lfitci genderbills term_num if gender==1 & percentofwomeninparty<0.13 , scheme(s1mono) ytitle("Number of gender-related bills") xtitle("Parliamentary tenure") xscale(range(0 8)) xlabel(0 2 4 6 8) legend(off) title("Low female rep in party") name(lowdesrep_party, replace)
	
graph twoway lfitci genderbills term_num if gender==1 & percentofwomeninparty>=0.13 , scheme(s1mono) ytitle("Number of gender-related bills") xtitle("Parliamentary tenure") xscale(range(0 8)) xlabel(0 2 4 6 8) legend(off) title("High female rep in party") name(highdesrep_party, replace)

graph combine  lowdesrep lowdesrep_party highdesrep highdesrep_party, scheme(s1mono) ycommon


*Figure 6
set scheme plotplain 
interflex genderbills term_num descr_repper Listmarginality parlrole percentofwomeninparty nonfemalepro in_govt partyfamily knesset_term if gender==1 , cl(MKID) type(linear)   ///
dlabel("tenure") xlabel("Female descriptive representation in parliament") ylabel(gender-related PMBs) title("") 

interflex genderbills term_num percentofwomeninpartynew Listmarginality parlrole descr_rep nonfemalepro in_govt partyfamily knesset_term if gender==1, cl(MKID) type(linear)  ///
dlabel("tenure") xlabel("Female descriptive representation in party") ylabel(gender-related PMBs) title("") 



**Table A3 
**********************************************************************************
*Model 1
nbreg genderbills c.term_num##c.descr_repper Listmarginality parlrole percentofwomeninparty nonfemalepro in_govt i.partyfamily knesset_term cs* if gender==1 , robust
*Model 2
nbreg genderbills c.term_num##c.percentofwomeninparty descr_repper Listmarginality parlrole nonfemalepro in_govt i.partyfamily knesset_term cs* if gender==1 , robust




